package dao;

import bean.Article;
import bean.User;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Map;

/*博客方法类*/
public interface ArticleDao {
    public boolean addArticle(Article article) throws SQLException;/*添加博客方法*/
    public ArrayList<Article> getArticles(User user) throws SQLException;/*获取个人所有博客方法*/
    public boolean deleteArticle(int articleId) throws SQLException;/*删除博客方法*/
    public boolean updateArticle(Article article) throws SQLException;/*修改博客方法*/
    public Article getArticle(int articleId) throws SQLException;/*获取单个博客*/
    public Map<String,ArrayList<Article>> getAllMapArticles() throws SQLException;/*获取所有用户的博客*/
    public ArrayList<Article> getAllArticles() throws SQLException;/*获取所有用户的博客*/
    public ArrayList<Article> getCollectedArticles(User user) throws SQLException;/*获取用户收藏过的博客*/
    public boolean recordArticle(int articleId,int views,int commentCount,int likeDegree,int like);/*保存博客数据*/
    public ArrayList<Article> getCommandArticle() throws SQLException;/*获取被推荐的博客*/
    public ArrayList<Article> getLikedArticles(User user) throws SQLException;/*获取点赞过的博客*/
    public ArrayList<Article> getCategoriesArticles(int categoryId) throws SQLException;/*获取某个目录下的全部博客文章*/
    public boolean updateDefaultCategory(ArrayList<Article> articles,int defaultCategoryId);/*将该目录下的博客改到默认目录下*/
    public ArrayList<Article> getPaginateArticle(int page,int cnt,User user) throws SQLException;/*获取分页*/
    public int getPage(User user) throws SQLException;/*获取分页数量*/
    public ArrayList<Article> getArticles(String account) throws SQLException;/*获取博客*/
}
